using SDK.Scripts.Module;
using SDK.Scripts.Plat;
using SDK.Scripts.Utils;

namespace SDK.Scripts.App
{
	public static class GameSDK
	{
		private static bool _hasRun;

		private static ModuleManager _moduleManager;

		public static BaseGamePlat _gamePlat;

		public static ModuleManager ModuleMgr
		{
			get
			{
				if (_moduleManager == null)
				{
					Run();
					_moduleManager = new ModuleManager();
				}
				return _moduleManager;
			}
		}

		public static BaseGamePlat GamePlat
		{
			get
			{
				if (_gamePlat == null)
				{
					_gamePlat = new GamePlatAndroid();
					_gamePlat.RegisterListing(Run());
				}
				return _gamePlat;
			}
		}

		private static string Run()
		{
			string text = "GameSDK";
			if (!_hasRun)
			{
				_hasRun = true;
				App.CreateSDK(text);
				Debuger.SetLogType(Debuger.LogType.debug);
			}
			return text;
		}
	}
}
